package com.wenson.behavior.responsibility;

/**
 * @ClassName: Approver
 * @Author: luowangcheng
 * @Date: 2024/6/15 16:39
 * @Description:
 */
public abstract class Approver {
    protected String name; //审批人姓名
    protected Approver nextApprover; //下一位审批人

    public Approver(String name) {
        this.name = name;
    }

    protected Approver setNextApprover(Approver nextApprover){
        this.nextApprover = nextApprover;
        return this.nextApprover; //返回下一位审批人，使其支持链式编程
    }

    public abstract void approve(int amount); //抽象审批方法，由具体审批人实现
}
